dojo.provide("lotex.html");

lotex.html = {
    jsonSelect: function(/*DomNode*/element, dataUri){
        element = dojo.byId(element);
        element.options.length = 0;
        element.options.add(new Option("","*!读取数据中...!*"));
        var json = dojo.io.bind({
            url: dataUri,
            error: function(type, data, evt){
                element.options.add(new Option("","*!连接服务器失败!*"));
            },
            load: function(type, data, evt) {
                var len = data.length;
                element.options.length = 0;
                for (var i=0; i<len; i++) {
                    element.options.add(new Option(data[i][1],data[i][0]));
                }
            },
            mimetype: "text/json"
        });
    }
}